import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
    state:{
        listIds:[],
        nextId:'',
    },
    mutations:{
        listId(state,ids){
            state.listIds = ids
        },
        next(state,payload){
            for(var i=0;i<state.listIds.length;i++) {
                if(state.listIds[i].id == payload ){
                    state.nextId = state.listIds[i+1].id
                }
            }
        }
    }
})
